<%@ page import="com.pension.model.dto.Member"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<!DOCTYPE html>

<html>
<head>
	<meta charset="utf-8" />
	<title>사용자등록</title>
	<link rel="Stylesheet" href="/pension/styles/default.css" />
	<link rel="Stylesheet" href="/pension/styles/input.css" />
	<script type="text/javascript">
	function checkAndSubmit() {
		var message = "";
		
		var passwd = document.getElementById("passwd");
		if (passwd.value.length == 0) {
			message += "비밀번호를 입력하세요.\r\n";
		}
		
		var confirm = document.getElementById("confirm");
		if (confirm.value != passwd.value) {
			message += "비밀번호 불일치.\r\n";
		}
		
		if (message.length > 0) {
			alert(message);
		} else {
			document.getElementById("modifyform").submit();
		}
	}
	</script>
</head>
<body>

	<div id="pageContainer">
	
		<% pageContext.include("/WEB-INF/views/include/header.jsp"); %>
		
		<div id="inputcontent">
			<br /><br />
		    <div id="inputmain">
		        <div class="inputsubtitle">회원기본정보</div>

				<% Member member = (Member)session.getAttribute("loginuser"); %>

		        <form id="modifyform" action="modify.action" method="post"><!-- 상대경로표시 -->
		        <table>
		            <tr>
		                <th>아이디(ID)</th>
		                <td>
		                	<input type="hidden" name="memberId" value="<%= member.getMemberId() %>" />
		                    <%= member.getMemberId() %>
		                </td>
		            </tr>
		            <tr>
		                <th>비밀번호</th>
		                <td>
		                	<input type="password" id="passwd" name="passwd" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>비밀번호 확인</th>
		                <td>
		                    <input type="password" id="confirm" name="confirm" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>이메일</th>
		                <td>
		                	<input type="text" name="email" style="width:280px" />
		                </td>
		            </tr>
		            <tr>
		                <th>연락처</th>
		                <td>
		                	<input type="text" name="phone1" style="width:280px" />
		                </td>
		            </tr>		            		            
		        </table>
		        <div class="buttons">
		        	<input type="button" value="등록" style="height:25px" onclick="checkAndSubmit();" />
		        	<input type="button" value="취소" style="height:25px"
		        		onclick="location.href='/pension/member/view.action?memberid=<%= member.getMemberId() %>';" />

		        </div>
		        </form>
		    </div>
		</div>   	
	
	</div>

</body>
</html>